home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat3 / Tcl / string.z / string
Encoding:
Text File  |  1998-10-30  |  8.2 KB  |  199 lines

  1.  
  2.  
  3.  
  4. ssssttttrrrriiiinnnngggg((((3333TTTTccccllll))))                                                      ssssttttrrrriiiinnnngggg((((3333TTTTccccllll))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      string - Manipulate strings
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ssssttttrrrriiiinnnngggg _o_p_t_i_o_n _a_r_g ?_a_r_g ...?
  13.  
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      Performs one of several string operations, depending on _o_p_t_i_o_n.  The
  17.      legal _o_p_t_i_o_ns (which may be abbreviated) are:
  18.  
  19.      ssssttttrrrriiiinnnngggg ccccoooommmmppppaaaarrrreeee _s_t_r_i_n_g_1 _s_t_r_i_n_g_2
  20.           Perform a character-by-character comparison of strings _s_t_r_i_n_g_1 and
  21.           _s_t_r_i_n_g_2 in the same way as the C ssssttttrrrrccccmmmmpppp procedure.  Return -1, 0, or
  22.           1, depending on whether _s_t_r_i_n_g_1 is lexicographically less than,
  23.           equal to, or greater than _s_t_r_i_n_g_2.
  24.  
  25.      ssssttttrrrriiiinnnngggg ffffiiiirrrrsssstttt _s_t_r_i_n_g_1 _s_t_r_i_n_g_2
  26.           Search _s_t_r_i_n_g_2 for a sequence of characters that exactly match the
  27.           characters in _s_t_r_i_n_g_1.  If found, return the index of the first
  28.           character in the first such match within _s_t_r_i_n_g_2.  If not found,
  29.           return -1.
  30.  
  31.      ssssttttrrrriiiinnnngggg iiiinnnnddddeeeexxxx _s_t_r_i_n_g _c_h_a_r_I_n_d_e_x
  32.           Returns the _c_h_a_r_I_n_d_e_x'th character of the _s_t_r_i_n_g argument.  A
  33.           _c_h_a_r_I_n_d_e_x of 0 corresponds to the first character of the string.  If
  34.           _c_h_a_r_I_n_d_e_x is less than 0 or greater than or equal to the length of
  35.           the string then an empty string is returned.
  36.  
  37.      ssssttttrrrriiiinnnngggg llllaaaasssstttt _s_t_r_i_n_g_1 _s_t_r_i_n_g_2
  38.           Search _s_t_r_i_n_g_2 for a sequence of characters that exactly match the
  39.           characters in _s_t_r_i_n_g_1.  If found, return the index of the first
  40.           character in the last such match within _s_t_r_i_n_g_2.  If there is no
  41.           match, then return -1.
  42.  
  43.      ssssttttrrrriiiinnnngggg lllleeeennnnggggtttthhhh _s_t_r_i_n_g
  44.           Returns a decimal string giving the number of characters in _s_t_r_i_n_g.
  45.  
  46.      ssssttttrrrriiiinnnngggg mmmmaaaattttcccchhhh _p_a_t_t_e_r_n _s_t_r_i_n_g
  47.           See if _p_a_t_t_e_r_n matches _s_t_r_i_n_g; return 1 if it does, 0 if it doesn't.
  48.           Matching is done in a fashion similar to that used by the C-shell.
  49.           For the two strings to match, their contents must be identical
  50.           except that the following special sequences may appear in _p_a_t_t_e_r_n:
  51.  
  52.           ****         Matches any sequence of characters in _s_t_r_i_n_g, including a
  53.                     null string.
  54.  
  55.           ????         Matches any single character in _s_t_r_i_n_g.
  56.  
  57.           [[[[_c_h_a_r_s]]]]   Matches any character in the set given by _c_h_a_r_s.  If a
  58.                     sequence of the form _x----_y appears in _c_h_a_r_s, then any
  59.                     character between _x and _y, inclusive, will match.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssttttrrrriiiinnnngggg((((3333TTTTccccllll))))                                                      ssssttttrrrriiiinnnngggg((((3333TTTTccccllll))))
  71.  
  72.  
  73.  
  74.           \\\\_x        Matches the single character _x.  This provides a way of
  75.                     avoiding the special interpretation of the characters
  76.                     ****????[[[[]]]]\\\\ in _p_a_t_t_e_r_n.
  77.  
  78.      ssssttttrrrriiiinnnngggg rrrraaaannnnggggeeee _s_t_r_i_n_g _f_i_r_s_t _l_a_s_t
  79.           Returns a range of consecutive characters from _s_t_r_i_n_g, starting with
  80.           the character whose index is _f_i_r_s_t and ending with the character
  81.           whose index is _l_a_s_t.  An index of 0 refers to the first character of
  82.           the string.  _L_a_s_t may be eeeennnndddd (or any abbreviation of it) to refer to
  83.           the last character of the string.  If _f_i_r_s_t is less than zero then
  84.           it is treated as if it were zero, and if _l_a_s_t is greater than or
  85.           equal to the length of the string then it is treated as if it were
  86.           eeeennnndddd.  If _f_i_r_s_t is greater than _l_a_s_t then an empty string is
  87.           returned.
  88.  
  89.      ssssttttrrrriiiinnnngggg ttttoooolllloooowwwweeeerrrr _s_t_r_i_n_g
  90.           Returns a value equal to _s_t_r_i_n_g except that all upper case letters
  91.           have been converted to lower case.
  92.  
  93.      ssssttttrrrriiiinnnngggg ttttoooouuuuppppppppeeeerrrr _s_t_r_i_n_g
  94.           Returns a value equal to _s_t_r_i_n_g except that all lower case letters
  95.           have been converted to upper case.
  96.  
  97.      ssssttttrrrriiiinnnngggg ttttrrrriiiimmmm _s_t_r_i_n_g ?_c_h_a_r_s?
  98.           Returns a value equal to _s_t_r_i_n_g except that any leading or trailing
  99.           characters from the set given by _c_h_a_r_s are removed.  If _c_h_a_r_s is not
  100.           specified then white space is removed (spaces, tabs, newlines, and
  101.           carriage returns).
  102.  
  103.      ssssttttrrrriiiinnnngggg ttttrrrriiiimmmmlllleeeefffftttt _s_t_r_i_n_g ?_c_h_a_r_s?
  104.           Returns a value equal to _s_t_r_i_n_g except that any leading characters
  105.           from the set given by _c_h_a_r_s are removed.  If _c_h_a_r_s is not specified
  106.           then white space is removed (spaces, tabs, newlines, and carriage
  107.           returns).
  108.  
  109.      ssssttttrrrriiiinnnngggg ttttrrrriiiimmmmrrrriiiigggghhhhtttt _s_t_r_i_n_g ?_c_h_a_r_s?
  110.           Returns a value equal to _s_t_r_i_n_g except that any trailing characters
  111.           from the set given by _c_h_a_r_s are removed.  If _c_h_a_r_s is not specified
  112.           then white space is removed (spaces, tabs, newlines, and carriage
  113.           returns).
  114.  
  115.      ssssttttrrrriiiinnnngggg wwwwoooorrrrddddeeeennnndddd _s_t_r_i_n_g _i_n_d_e_x
  116.           Returns the index of the character just after the last one in the   |
  117.           word containing character _i_n_d_e_x of _s_t_r_i_n_g.  A word is considered to |
  118.           be any contiguous range of alphanumeric or underscore characters, or|
  119.           any single character other than these.
  120.  
  121.      ssssttttrrrriiiinnnngggg wwwwoooorrrrddddssssttttaaaarrrrtttt _s_t_r_i_n_g _i_n_d_e_x
  122.           Returns the index of the first character in the word containing     |
  123.           character _i_n_d_e_x of _s_t_r_i_n_g.  A word is considered to be any          |
  124.           contiguous range of alphanumeric or underscore characters, or any   |
  125.           single character other than these.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ssssttttrrrriiiinnnngggg((((3333TTTTccccllll))))                                                      ssssttttrrrriiiinnnngggg((((3333TTTTccccllll))))
  137.  
  138.  
  139.  
  140. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  141.      case conversion, compare, index, match, pattern, string, word
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.